package asjava.uniobjects;

import asjava.uniclientlibs.*;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author msowders
 */
public class UniSessionStub extends asjava.uniobjects.UniSession {
    private UniCommandStub commandStub;
    private boolean successful = true;

    public UniSessionStub(){
        try {
            commandStub = new UniCommandStub(this);
        } catch (UniCommandException ex) {
            Logger.getLogger(UniSessionStub.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    @Override
    public UniCommand command() throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return command("");
    }

    @Override
    public UniCommand command(Object paramObject) throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        commandStub.setCommand((String)paramObject);
        return commandStub;
    }

    @Override
    public void connect() throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void connect(Object paramObject1, Object paramObject2, Object paramObject3, Object paramObject4)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void connect(Object paramObject1, int paramInt, Object paramObject2, Object paramObject3, Object paramObject4)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void connect(Object paramObject1, Object paramObject2, Object paramObject3, Object paramObject4, Object paramObject5, Object paramObject6)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void connect(Object paramObject1, Object paramObject2, Object paramObject3, Object paramObject4, Object paramObject5, int paramInt, Object paramObject6)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void connect(Object paramObject1, int paramInt, Object paramObject2, Object paramObject3, Object paramObject4, Object paramObject5, Object paramObject6)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void disconnect() throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public UniDataSet dataSet() {
        return null;
    }

    @Override
    public UniDynArray dynArray() {
        return null;
    }

    @Override
    public UniDynArray dynArray(Object paramObject) {
        return null;
    }

    @Override
    public String getAtVariable(int paramInt) throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return null;
    }

    @Override
    public int getDefaultBlockingStrategy() {
        return 1;
    }

    @Override
    public int getDefaultLockStrategy() {
        return 1;
    }

    @Override
    public int getDefaultReleaseStrategy() {
        return 1;
    }

    @Override
    public int getMaxOpenFiles() {
        return 1;
    }

    @Override
    public int getNumOpenFiles() {
        return 1;
    }

    @Override
    public UniSSLDescriptor getSSLDescriptor() {
        return null;
    }

    @Override
    public UniString iconv(Object paramObject1, Object paramObject2)
            throws UniStringException {
        return null;
    }

    @Override
    public boolean isnSecure() {
        return true;
    }

    @Override
    public int getSSLMode() {
        return 1;
    }

    @Override
    public UniNLSlocale nlsLocale() throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return null;
    }

    @Override
    public UniNLSmap nlsMap() throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return null;
    }

    @Override
    public UniString oconv(Object paramObject1, Object paramObject2)
            throws UniStringException {
        return null;
    }

    @Override
    public UniFile openFile(Object paramObject) throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return null;
    }

    @Override
    public UniFile open(Object paramObject) throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return null;
    }

    @Override
    public UniDictionary openDict(Object paramObject) throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return null;
    }

    @Override
    public UniSequentialFile openSeq(Object paramObject1, Object paramObject2, boolean paramBoolean)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return null;
    }

    @Override
    public void releaseTaskLock(int paramInt) throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public UniSelectList selectList(int paramInt) throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return null;
    }

    @Override
    public void setAtVariable(int paramInt, Object paramObject)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void setCompressionThreshold(int paramInt)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void setDefaultBlockingStrategy(int paramInt)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void setDefaultEncryptionType(int paramInt)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void setDefaultLockStrategy(int paramInt)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void setDefaultReleaseStrategy(int paramInt)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void setSSLDescriptor(UniSSLDescriptor paramUniSSLDescriptor) {
    }

    @Override
    public void setTaskLock(int paramInt) throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public void setTimeout(int paramInt) throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
    }

    @Override
    public int status() {
        return 1;
    }

    @Override
    public UniSubroutine subroutine(Object paramObject, int paramInt)
            throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return null;
    }

    @Override
    public UniXML xml() throws UniSessionException {
        if(!this.successful) throw new UniSessionException("Expected", 1);
        return null;
    }

    @Override
    public UniTransaction transaction() throws UniSessionException {
        return null;
    }

    @Override
    public String getSessionEncoding() {
        return null;
    }

    @Override
    public void setSessionEncoding(String paramString)
            throws UniSessionException {
    }

    public void setSuccessful(boolean successful){
        this.successful = successful;
    }
}
